package com.shujia.six;

import org.junit.Test;

import java.util.Random;

public class RandomDemo {

    @Test
    public void test1() {
        Random random = new Random(10);
        Random random1 = new Random(10);

        for (int i = 0; i < 30; i++) {
            System.out.println("random:" + random.nextDouble());
            System.out.println("random1:" + random1.nextDouble());
        }
    }

    public static void main(String[] args) {
//        Random random = new Random();

        Random random = new Random(2);

        int num = random.nextInt(3);
        System.out.println(num);

        num = random.nextInt(3);
        System.out.println(num);

    }
}
